<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>

    <div id="root">
        <h1>您好，{{name}}</h1>
        <button v-on:click="showInfo">点我提示信息(不传参)</button>
        <button @click="showInfo1(66,$event)">点我提示信息!!!（传参）</button>
    </div>

    <script>
        Vue.config.productionTip = false

        const x = new Vue({
            el:'#root', 
            data:{
                name:'魔法师'
            },
            methods: {
                showInfo(event){
                    console.log(event.target.innerText);
                    alert('同学您好');
                },

                showInfo1(number,a){
                    alert('同学您好'+number);
                    console.log(a.target.innerText);
                }
            },
        })
    </script>
</body>
</html>